@model IEnumerable<ZKEACMS.Product.Models.ProductCategoryTag>
@{
    Layout = null;
}
<div class="panel panel-default">
    <div class="panel-heading">
        @L("标签")
    </div>
    <div class="panel-body" id="category-tags">
        <ul class="fullRowList tags">
            @foreach (var item in Model.Where(m => m.ParentId == 0).OrderBy(m => m.ID))
            {
                <li>
                    <div>
                        <a href="javascript:" class="btn-add-tag" data-id="@item.ID"><i class="glyphicon glyphicon-plus"></i></a>
                        <a href="javascript:" class="btn-delete-tag" data-id="@item.ID"><i class="glyphicon glyphicon-trash"></i></a>
                        <input class="tag-input" id="tag-@item.ID" data-id="@item.ID" data-pid="@item.ParentId" type="text" value="@item.Title" />
                        <code>@L("按回车保存")</code>
                    </div>
                    <ul>
                        @foreach (var child in Model.Where(m => m.ParentId == item.ID).OrderBy(m => m.ID))
                        {
                            <li>
                                <a href="javascript:" class="btn-delete-tag" data-id="@child.ID"><i class="glyphicon glyphicon-trash"></i></a>
                                <input class="tag-input" id="tag-@child.ID" data-id="@child.ID" data-pid="@child.ParentId" type="text" value="@child.Title" />
                                <code>@L("按回车保存")</code>
                            </li>
                        }
                    </ul>
                </li>
            }

        </ul>
    </div>
    <div class="panel-footer">
        <a href="javascript:" class="btn-add-tag" data-category="@ViewBag.ProductCategoryId" data-id="0">@L("添加")</a>
    </div>
</div>